<template>
    <div>
        <van-nav-bar>
            <template #left>
                <van-icon name="home-o" color="#1989fa" size="20" />
            </template>
            <template #title>
                <van-search v-model="value" placeholder="请输入搜索关键词" input-align="center" />

            </template>
            <template #right>
                <van-icon name="cart-o" color="#1989fa" size="20" :badge="total" />
            </template>
        </van-nav-bar>
    </div>
</template>
<script setup lang="ts">
import {ref ,onMounted} from 'vue'
import {storeToRefs} from 'pinia'
import {useCart} from '../stores/carts'
const store = useCart()
const {listNum ,total} = storeToRefs(store)
const value = ref('')
onMounted( async ()=>{
    await store.feAcartList()
})
</script>
<style scoped>
.van-search{
    padding: unset;
}
</style>